package com.ardf.service;

import com.ardf.entity.Athlete;
import com.ardf.entity.dto.AthleteTableDto;
import com.ardf.entity.dto.ReplaceCardTableDto;
import com.ardf.entity.vo.AddOneAthleteVo;
import com.ardf.entity.vo.EditAthleteVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author ShiYunHao
 * @since 2025-01-06
 */
public interface IAthleteService extends IService<Athlete> {

    /**
     * 导入选手
     * @param file 选手表格
     */
    void upload(MultipartFile file,Long competitionId, HttpServletResponse response) throws IOException;
    /**
     * 模板下载
     */
    void download(HttpServletResponse response) throws IOException;

    /**
     *分页
     */
    Page<AthleteTableDto> getAthleteTablePage(Integer pageSize, Integer pageNum, Long competitionId);

    /**
     * 单个删除
     * @param id
     */
    void deleteById(Long id);

    /**
     * 批量删除
     * @param ids
     */
    void deleteAll(List<Long> ids);

    /**
     * 补增选手
     */
    void addOne(AddOneAthleteVo addOneAthleteVo);

    /**
     * 有条件的分页
     */
    Page<AthleteTableDto> searchAll(Integer pageSize, Integer pageNum, Long competitionId, String searchAll);

    /**
     * 编辑选手
     * @param editAthleteVo
     */
    void editOne(EditAthleteVo editAthleteVo);

    /**
     * author:容伟洪
     * time:2025-3-8
     * description：查询当前赛事的所有选手包含的信息，用于补卡查询
     */
    List<ReplaceCardTableDto> selectAllAthleteByComId(Long competitionId);
}
